// Copyright 2012 The golab Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package sys

import "../../cmd"

func newCmd(p string, arg ...string) *cmd.Cmd {
	a := []string{"-a"}
	if len(arg) > 0 {
		a = arg
	}
	c := &cmd.Cmd{
		Path: p,
		Args: append([]string{p}, a...),
	}
	return c
}

func Uname(arg ...string) *cmd.Cmd {
	return newCmd("uname", arg...)
}

func Netstat(arg ...string) *cmd.Cmd {
	return newCmd("netstat", arg...)
}

func Ifconfig(arg ...string) *cmd.Cmd {
	return newCmd("ifconfig", arg...)
}

func Sysctl(arg ...string) *cmd.Cmd {
	return newCmd("sysctl", arg...)
}

func Reboot() *cmd.Cmd {
	c := &cmd.Cmd{
		Path: "reboot",
		Args: []string{"reboot"},
	}
	return c
}
